package com.wva.captcha.consumer;

import com.wva.captcha.domain.dto.SmsCaptchaSendDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: hong
 * @Date: 2025/2/4 16:14:48
 */
@Component
@RabbitListener(queues = "captcha.sms.send")
@Slf4j
public class SmsCaptchaSendQueueConsumer {
    @RabbitHandler
    void handle(SmsCaptchaSendDTO smsCaptchaSendDTO) {
        String phone = smsCaptchaSendDTO.getPhone();
        Integer code = smsCaptchaSendDTO.getCode();
        log.info("发送了短信验证码{}到{}", code, phone);
    }
}
